// 可索引签名
const symid = Symbol("productno");
interface Product {
  [symid]: number | string;
  name: string;
  price: number;
  account: number;
  buy(): void;
}

// Product[类型]： 获取当前接口当前类型的类型
type A = Product["buy"];
type B = Product["buy" | "name"];
// symid表示一个变量，不能当作类型使用
type S = Product[typeof symid];

type PKeys = keyof Product; // "name" | "price" | "account" | "buy" | "typeof symid"

type AllKeys<T> = T extends any ? T : never;
type Pkeys2 = AllKeys<keyof Product>;

export {};
